﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SetProductDialog.aspx.cs" Inherits="ZLCMS.Web.SystemManage.Basics.Shop.ShippingProduct.SetProductDialog" %>

<form id="shippingDialog" runat="Server" class="pageForm required-validate">
<!-- 需保存的全局变量 -->
<asp:label runat="server" id="_oid" visible="False"></asp:label>
<div class="pageContent">
    <div class="pageFormContent" layouth="56">
        <dl class="nowrap">
            <dt>商品选择：</dt>
            <dd>
                <asp:dropdownlist runat="server" id="ddl_productlist" prop="ProductList"></asp:dropdownlist>
            </dd>
        </dl>
        <dl class="nowrap">
            <dt>商品数量：</dt>
            <dd>
                <input type="text" width="100px" prop="Count" runat="Server" id="prouctcount">
            </dd>
        </dl>
       
                <input type="hidden" prop="key" value="<%=Request["key"] %>">
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="button" onclick="return saveShippingItem()">
                            保存</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">
                            取消</button></div>
                </div>
            </li>
        </ul>
    </div>
</div>
</form>
<script type="text/javascript">
    function saveShippingItem() {
        var skuno = $('#shippingDialog').find('[prop=ProductList]').val();
        if (skuno == "-1") {
            alert("请选择商品");
            return;
        }
        var count = parseInt($('#shippingDialog').find('[prop=Count]').val());
        if (!(count > 0 && count < 99999)) {
            alert("请输入商品数量");
            return;
        }
        $.get("/SystemManage/Basics/Shop/ShippingProduct/SetProductDialog.aspx?sid=<%=Request["sid"] %>", { ajax:'1', skuno: skuno, count: count, key:$('#shippingDialog').find('[prop=key]').val() },
          function (data) {
            $.pdialog.closeCurrent();
            navTab.reloadFlag('ShippingProductDetail');
          }); 
    };
</script>
